package com.fangyouyun;

import com.fangyouyun.pojo.User;
import com.fangyouyun.service.UserServiceImpl;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.IOException;
import java.util.List;
import java.util.Map;

public class Main {

    private static Logger log = LoggerFactory.getLogger(Main.class);

    public static void main(String[] args) throws IOException {
        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("springApplication.xml");
        UserServiceImpl userServiceImpl = (UserServiceImpl) context.getBean("userServiceImpl");
        List<User> all = userServiceImpl.getAll();
        System.out.println(all);
        Integer stringObjectMap = userServiceImpl.countUser();
        System.out.println(stringObjectMap);
        log.info("spring 服务启动.............");
        System.in.read();
    }

}
